<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<link href="<%=basePath%>ueditor/themes/default/css/ueditor.css" rel="stylesheet" type="text/css">

<script type="text/javascript" charset="gbk">
window.UEDITOR_HOME_URL = "/mcstu/ueditor/";//编辑器项目路径
	</script>
	<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/lang/zh-cn/zh-cn.js"></script>
		<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_config.js"></script>
	<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_all.js"></script>
			<form action="<%=basePath %>backend/adddata" method="post" id='traderForm'>
			<div class="row">
              <div class="col-sm-6 input-group">
                 <span class="input-group-addon">主菜单</span>
                  <select class="form-control" id='pmenu' name='pmenu'>
                  <option value='0'>---请选择---</option>
                  <c:forEach items="${ pmenus}" var="menu">
                     <option value="${menu.id }">${menu.name }</option>
                  </c:forEach>
                  </select>
               </div>
               <div class="col-md-6 input-group" >
                 <span class="input-group-addon">從菜單</span>
                   <select class="form-control" id='smenu' name='smenu' >
                       <option value='0'>---请选择---</option>
                  </select>  
               </div>
               <!-- Optional: clear the XS cols if their content doesn't match in height -->
               <div class="clearfix visible-xs"></div>
              
           </div>
           <div class="row">
          <div class="col-sm-12 input-group" style='margin-top:10px;'>
                 <span class="input-group-addon">內容標題</span>
                 <select class="form-control" id='tmenu' name='tmenu'>
                    <option value='0'>---请选择---</option>
                  </select>
              </div>
              </div>
			  <div style='margin-top: 10px;'>
			  
		       <script  id="editor" ></script>
		       </div>
	
		<input type="submit" value="完成" style="margin-left: 700px;margin-top: 10px;" class="btn btn-info" onclick="return getContent();"/></div>
		<input id="context" type="hidden" name="context">
	</form>
	
	<script type="text/javascript">
	var ue = UE.getEditor('editor');
    function getContent() {
        var str= ue.getContent();
        document.getElementById('context').value=str;
        if(document.getElementById('title').value.length==0||str.length==0)
        	{
        	alert('还有尚未填写的内容！');
        	  document.getElementById('title').focus();
        	  return false;
        	}
        return true;
    }
</script>
